package net.celisdelafuente.java.Acacia.entity;

import java.util.Date;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName="books")
public class Book {

	@DatabaseField(columnName="id", generatedId=true)
	private int id;
	
	@DatabaseField(columnName="title", canBeNull=false)
	private String title;
	
	@DatabaseField(columnName="subtitle", canBeNull=true)
	private String subtitle;
	
	@DatabaseField(columnName="synopsis", canBeNull=true)
	private String synopsis;
	
	@DatabaseField(columnName="isbn", canBeNull=true)
	private String isbn;

	@DatabaseField(columnName="edition", canBeNull=true)
	private int edition;
	
	@DatabaseField(columnName="pubdate", canBeNull=true)
	private Date pubdate;
	
	@DatabaseField(columnName="bulk_price", canBeNull=true)
	private float bulk_price;
	
	@DatabaseField(columnName="retail_price", canBeNull=true)
	private float retail_price;
	
	@DatabaseField(columnName="author_id", canBeNull=true,
			foreign=true)
	private Author author;
	
	@DatabaseField(columnName="publisher_id", canBeNull=true,
			foreign=true)
	private Publisher publisher;
	
	@DatabaseField(columnName="supplier_id", canBeNull=true,
			foreign=true)
	private Supplier supplier;
	
	@DatabaseField(columnName="classification_id", canBeNull=true,
			foreign=true)
	private Classification classification;
	
	@DatabaseField(columnName="status", canBeNull=true)
	private String status;
	
	@DatabaseField(columnName="quantity", canBeNull=true, defaultValue ="1")
	private int quantity;
	
	public Book() {}
	
	public Book(String title) {
		this.title = title;
	}
	
	public Book(String title, String subtitle) {
		this.title = title;
		this.subtitle = subtitle;
	}
	
	public Book(String title, String subtitle, String authorsFullName) {
		this.title = title;
		this.subtitle = subtitle;
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSubtitle() {
		return subtitle;
	}

	public void setSubtitle(String subtitle) {
		this.subtitle = subtitle;
	}

	public String getSynopsis() {
		return synopsis;
	}

	public void setSynopsis(String synopsis) {
		this.synopsis = synopsis;
	}

	public String getIsbn() {
		return isbn;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	public int getEdition() {
		return edition;
	}

	public void setEdition(int edition) {
		this.edition = edition;
	}

	public Date getPubdate() {
		return pubdate;
	}

	public void setPubdate(Date pubdate) {
		this.pubdate = pubdate;
	}
	
	public Author getAuthor() {
		return this.author;
	}
	
	public void setAuthor(Author author) {
		this.author = author;
	}

	public Publisher getPublisher() {
		return publisher;
	}

	public void setPublisher(Publisher publisher_id) {
		this.publisher = publisher_id;
	}

	public Supplier getSupplier() {
		return supplier;
	}

	public void setSupplier_id(Supplier supplier_id) {
		this.supplier = supplier_id;
	}

	public Classification getClassification() {
		return classification;
	}

	public void setClassification(Classification classification_id) {
		this.classification = classification_id;
	}

	public float getBulk_price() {
		return bulk_price;
	}

	public void setBulk_price(float bulk_price) {
		this.bulk_price = bulk_price;
	}

	public float getRetail_price() {
		return retail_price;
	}

	public void setRetail_price(float retail_price) {
		this.retail_price = retail_price;
	}

	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}
	
	public String getStatus() {
		return this.status;
	}
	
	public void setStatus(String status) {
		this.status = status;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	
	
}
